<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>机台信息录入</title>
<script type="text/javascript">
//保存并查询
function doUpd(){
	if(check()){
		if(confirm("确认修改信息?")){
			document.all.operate.value = "updinfo";
			document.forms[0].submit();
		}
	}
}
 //限制添加快捷内容的字数  
var maxLength =30; 
function MaxInput(fo,len) {
	if(len!=""){
		maxLength=len;
	}
	if (fo.value.length > maxLength) {
		alert("输入内容过多！");
		fo.value = fo.value.substring(0, maxLength);
	}
}
function doback(){
	history.back();
	//document.all.operate.value = "";
	//document.forms[0].submit();
}
//验证标识不能重复
function doChecking(obj){
	if(obj.value!=""){
		ajax.checkOneData("pres_machineinfo pm",obj.name,obj.value,function(back){
			if(back){
				_alert(obj.title + "重复，请重新输入。");
				obj.value = "";
				obj.focus();
			}
		});
	}
}
</script>
</head>
<body>
<form action="<%=path %>/machineinfo.action" method="post">
<table width="70%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
      <tr>
        <td width="760" class="MainBody_title"><hello:forValue type="title" /></td>
      </tr>
        <tr>
          <td valign="top"><input name="operate" type="hidden" value=""/>
          <input name="pm.id" type="hidden" value="${updinfo.id}"/>
          <%--<input name="pm.createuser" type="hidden" value="${sessionScope.admin_user.personid}"/>--%>
          <div align="right" style="padding: 10 50 10 0;">
			<input type="button" class="btn" value="修 改" onclick="doUpd()"/>&nbsp;&nbsp;
			<!--<input type="reset" class="btn" value="重 置" />&nbsp;&nbsp;-->
			<input type="button" class="btn" value="返 回" onclick="doback()"/>&nbsp;&nbsp;</div>
          <table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table">
                <tr>
                  <td colspan="4" class="bg_title">印 刷 机 台 信 息</td>
                </tr>
                <tr>
                  <th width="15%" nowrap="nowrap">机台编号</th> 
                  <td width="35%"><input name="pm.machineid" type="text" value="${updinfo.machineid}" readonly class="readinput" title="机台编号"/></td>
                  <th width="15%" nowrap="nowrap">机台名称</th>
                  <td width="35%" ><input name="pm.machinename" type="text" maxlength="50" value="${updinfo.machinename}" onblur="doChecking(this)" check="checkBlank" class="notnull" title="机台名称"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">厂商</th> 
                  <td ><input name="pm.manufacturer" type="text" value="${updinfo.manufacturer}" maxlength="50"/></td>
                  <th nowrap="nowrap">类型</th> 
                  <td ><input name="pm.machinetype" type="text" value="${updinfo.machinetype}" maxlength="50"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">规格</th> 
                  <td ><input name="pm.standard" type="text" value="${updinfo.standard}" maxlength="50"/></td>
                  <th nowrap="nowrap">制备时间</th> 
                  <td ><input name="pm.preparation" type="text" value="${updinfo.preparation}" maxlength="50"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">所属车间</th> 
                  <td ><select name="pm.workshop" style="width: 98%"></select></td>
                  <th nowrap="nowrap">所需耗材1</th> 
                  <td ><select name="pm.needmak1" style="width: 98%">
                  <option value="" >请选择</option>
                  <c:forEach var="mak" varStatus="status" items="${maklist}">
					<option value="${mak.goodsname }" <c:if test="${updinfo.needmak1==mak.goodsname}">selected</c:if>>${mak.goodsname }</option>
					</c:forEach></select></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">所需耗材2</th> 
                  <td ><select name="pm.needmak2" style="width: 98%">
                  <option value="" >请选择</option>
                  <c:forEach var="mak" varStatus="status" items="${maklist}">
					<option value="${mak.goodsname }" <c:if test="${updinfo.needmak2==mak.goodsname}">selected</c:if>>${mak.goodsname }</option>
					</c:forEach></select></td>
                  <th nowrap="nowrap">所需耗材3</th> 
                  <td ><select name="pm.needmak3" style="width: 98%">
                  <option value="" >请选择</option>
                  <c:forEach var="mak" varStatus="status" items="${maklist}">
					<option value="${mak.goodsname }" <c:if test="${updinfo.needmak3==mak.goodsname}">selected</c:if>>${mak.goodsname }</option>
					</c:forEach></select></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">所需耗材4</th> 
                  <td ><select name="pm.needmak4" style="width: 98%">
                  <option value="" >请选择</option>
                  <c:forEach var="mak" varStatus="status" items="${maklist}">
						<option value="${mak.goodsname }" <c:if test="${updinfo.needmak4==mak.goodsname}">selected</c:if>>${mak.goodsname }</option>
						</c:forEach></select></td>
                  <th nowrap="nowrap">所需耗材5</th> 
                  <td ><select name="pm.needmak5" style="width: 98%">
                  <option value="" >请选择</option>
                  <c:forEach var="mak" varStatus="status" items="${maklist}">
						<option value="${mak.goodsname }" <c:if test="${updinfo.needmak5==mak.goodsname}">selected</c:if>>${mak.goodsname }</option>
						</c:forEach></select></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">负责人</th> 
                  <td><select name="pm.operater" style="width: 98%">
                  	<c:forEach var="person" varStatus="status" items="${personlist}">
						<option value="${person.personname }" <c:if test="${updinfo.personname==person.personname}">selected</c:if>>${person.personname }</option>
						</c:forEach></select></td>
                  <th nowrap="nowrap">是否闲置</th> 
                  <td ><input name="pm.applyflag" type="radio" value="y" <c:if test="${updinfo.applyflag=='y'}">checked</c:if>/>应用&nbsp;&nbsp;&nbsp;&nbsp;
                  	  <input name="pm.applyflag" type="radio" value="n" <c:if test="${updinfo.applyflag=='n'}">checked</c:if>/>闲置</td>
                </tr>
                
                <tr>
                  <th align="center" nowrap="nowrap" >备注信息</th> 
                  <td colspan="3"><textarea name="pm.remark" style="width: 100%;" rows="5" onblur="MaxInput(this,100)">${updinfo.remark}</textarea></td>
                </tr>
            </table>
		</td>
	</tr>
</table></td></tr></table>
<script type="text/javascript">
doSelectInfo(document.all["pm.workshop"],'workshop','${updinfo.workshop}',false);
</script>
</form>
</body>
</html>